#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <ogc/conf.h>
#include <ogc/pad.h>

#include "network.h"
#include "tools.h"
#include "settings.h"

#define INSPECTMII_VERSION	"v1.2"


/*
 ___                           _   __  __ _ _ 
|_ _|_ __  ___ _ __   ___  ___| |_|  \/  (_|_)
 | || '_ \/ __| '_ \ / _ \/ __| __| |\/| | | |
 | || | | \__ \ |_) |  __/ (__| |_| |  | | | |
|___|_| |_|___/ .__/ \___|\___|\__|_|  |_|_|_|
              |_|                             
*/
static const char *ascii_1 = "\n\n\n\n\n\n\n\x1b[30;1m\t\t\t\t  ___ \t\t\t\t\t\t\t_  \x1b[31;1m __  __ _ _ \n";
static const char *ascii_2 = "\x1b[30;1m\t\t\t\t |_ _|_ __  ___ _ __   ___  ___| |_\x1b[31;1m|  \\/  (_|_)\n";
static const char *ascii_3 = "\x1b[30;1m\t\t\t\t  | || '_ \\/ __| '_ \\ / _ \\/ __| __\x1b[31;1m| |\\/| | | |\n";
static const char *ascii_4 = "\x1b[30;1m\t\t\t\t  | || | | \\__ \\ |_) |  __/ (__| |_\x1b[31;1m| |  | | | |\n";
static const char *ascii_5 = "\x1b[30;1m\t\t\t\t |___|_| |_|___/ .__/ \\___|\\___|\\__\x1b[31;1m|_|  |_|_|_|\n";
static const char *ascii_6 = "\x1b[30;1m\t\t\t\t\t\t\t   |_|\n\n\n\n\n\n\n\n\n\n";

//---------------------------------------------------------------------------------
int main(int argc, char **argv) {
//---------------------------------------------------------------------------------
	Initialize();
	Banner("InspectMii " INSPECTMII_VERSION " by JoostinOnline (HacksDen.com)");
	
	printf(ascii_1);
	printf(ascii_2);
	printf(ascii_3);
	printf(ascii_4);
	printf(ascii_5);
	printf(ascii_6);

	CHANGE_COLOR(YELLOW);
	printf("Press any key to continue");
	pressanykey();
	
	Banner("Non-configurable Settings (setting.txt):");
	SettingInfo();
	
	Banner("Configurable Settings (SYSCONF):");
	SysConfInfo1();
	
	Banner("Configurable Settings (SYSCONF):");
	SysConfInfo2();
	
	Banner("Misc and Developement Unit Settings (SYSCONF):");
	SysConfInfo3();
	
	Banner("WPad Devices (BT.DINF in SYSCONF):");
	BTInfo();
	
	u8 i;
	if (NetworkInitialized) {
		for(i=0; i<3; i++) {
			Banner("Network Info (config.dat):");
			NetworkInfo(i);
		}
	}
	CHANGE_COLOR(YELLOW);
	printf("\nPress any key to exit");
	pressanykey();
	
	Deinitialize();
	exit(0);
}
